1. Field of the Invention
The invention relates to image processing method and apparatus for reading a document image and identifying position and attributes of the document.
2. Related Background Art
A flow of processes of a conventional optical character recognizing apparatus will now be described in accordance with a flowchart of FIG. 47. In step S4701, an image is read by a scanner and image information is converted into a binary electric signal. The read data is displayed by a display in step S4702. In step S4703, the operator sets a recognition target area as a rectangle of arbitrary size and position by using a pointing device. Since a vertical type-setting document and a horizontal type-setting document exist in Japanese documents, it is necessary to decide an attribute regarding the vertical or horizontal type-setting, namely, type-setting direction before a character extracting process is executed. Therefore, the type-setting direction is deduced for such an area in step S4704. A character extracting process for extracting a character image every character in accordance with the result of the deduction in step S4705. A recognizing process is executed in step S4706. The recognition result is displayed on a display in step S4707 and is edited or preserved in accordance with an instruction of the operator.
There is also a case where it is very difficult to deduce the type-setting direction in dependence on an input document and it is erroneously deduced in step S4704. In the above conventional example, however, there is no means for confirming and correcting by the operator in the case where the type-setting direction was erroneously deduced, so that there is a drawback such that the process is continued in the wrong type-setting direction causing an incorrect recognition result.
Hitherto, there is an apparatus such that in the case where image information is a document having a complicated construction such that a column setting was performed or a plurality of headlines are arranged at random, the operator divides the position of the document into a plurality of rectangles and designates them and also designates the order of each rectangle or the relation with the headline thereof as attributes of the rectangle.
Hitherto, as a method of dividing the area of a table from the image data of a document in which a plurality of kinds of data such as body, photograph, table, and the like mixedly exist, a method of obtaining from a ratio between the area of such an area and the number of pixels is used.
However, the above conventional technique for ordering the headlines has a problem such that in case of an original such as a newspaper article or the like in which a headline exists so as to be surrounded by the body, the headline enters the body and is recognized and disturbs a flow of sentences of the body.
The above conventional technique for the area division has a problem such that in the case where a separator or the like which occurs due to a complicated polygonal line or the like is handled as one area, when the number of pixels for the area of a circumscribed rectangle increases, such an area is erroneously judged as a table area, so that a precision of the area division decreases.